<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <script src="./promise.js"></script>
    <title>Document</title>
</head>
<body>
    <script>
        let p = new Promise((res,rej)=>{
            res('ok')
        })
        p.then(value =>{
            function setCookie(name, value, day) {
                var date = new Date();
                date.setDate(date.getDate() + day);
                document.cookie = name + '=' + value + ';expires=' + date;
            };
            setCookie(name,22,3)
        },reason =>{
            console.log(reason);
        })
    </script>
</body>
</html>